package com.jstide.credit.data.service.biz;

import cn.hutool.db.Entity;
import com.jstide.credit.data.service.Algorithm;
import lombok.Getter;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.sql.ResultSet;
import java.util.List;
import java.util.Optional;
import java.util.Set;
import java.util.stream.Collectors;
import java.util.stream.Stream;

public class Factor19 extends Algorithm {

    public static final Logger logger = LoggerFactory.getLogger(Factor19.class);

    @Getter
    public final  String name="19";

    //“律师、医师、药师、审计师、统计师”
    //40
    @Getter
    public  final String sql ="  select  ZCZSMC from ZRRZYZYZGZCXX  where join_id=@joinId  ";


    @Override
    public int translate(String rs) {
        return 0;
    }

    @Override
    public int translate(List<Entity> rs) {
        int score = 0;
        Set<String> zy = Stream.of("律师","医师","药师","审计师","统计师").collect(Collectors.toSet());
        if(null!=rs && rs.size()>0){
            score = rs.stream().filter(t-> zy.contains(t.getStr("ZCZSMC"))).count()>0 ? 40:0;
        }
        return score;
    }
}
